package first_practice;

/**
 * @author ZhiWen Ren
 * @version 1.0
 * @description: LeetCode-104-二叉树的最大深度
 * @date 2025/4/1 20:44
 */
public class Solution104 {
    public int maxDepth(TreeNode root) {
        if (root == null)
            return 0;
        int leftH = maxDepth(root.left);
        int rightH = maxDepth(root.right);
        return Math.max(leftH, rightH) + 1;
    }
}
